import Vue from 'vue'
import App from './App'
// import utils from "./utils/utils.js"
import utils from "./utils/util.js"
import tui from './common/tui.js' // 普通的快速工具类
import cacheHelper from './common/cacheHelper.js' // 缓存工具类
import api from './common/api/api.js' //api 接口
import MescrollBody from "@/components/mescroll-uni/mescroll-body.vue" //下拉刷新
import MescrollUni from "@/components/mescroll-uni/mescroll-uni.vue" //下拉刷新
import '@/static/css/global.css'
import "./utils/wxjssdk.js"

Vue.component('mescroll-body', MescrollBody)
Vue.component('mescroll-uni', MescrollUni)
Vue.config.productionTip = false
Vue.prototype.tui = tui
Vue.prototype.api = api
// Vue.prototype.util=util
Vue.prototype.utils = utils
Vue.prototype.cacheHelper = cacheHelper

import wechat from './utils/wechat.js'
Vue.prototype.$wechat = wechat;

App.mpType = 'app'
const app = new Vue({
	...App
})
app.$mount()
if (location.href.indexOf('qrresult') !== -1 && uni.getStorageSync('uid')) {
	let codes =utils.getQueryString('qrresult')
	if (codes.indexOf("#")>-1)
	    codes = codes.replace('#','')
	if (codes.indexOf("/")>-1)
	    codes =codes.replace("/",'')
	cacheHelper.setQrResult(codes)
	uni.switchTab({
		url: 'pages/verificate/scan',
		success() {
			console.log('成功')
		},
		fail(e) {
			console.log(e)
		}
	});
	// location.host += '#/pages/verificate/scan'
}